package com.beidu.lottery.call.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 投票选项表
 * </p>
 *
 * @author 北渡
 * @since 2023-08-23
 */
@Data
@TableName("b_activity_vote_option")
@ApiModel(value = "VoteOption对象", description = "投票选项表")
public class ActivityVoteOption {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "选项ID不能为空")
    private Integer id;

    @ApiModelProperty(value = "租户编码")
    @TableField(select = false)
    private String tenantCode;

    @ApiModelProperty(value = "活动ID")
    @TableField(select = false)
    private Integer activityId;

    @ApiModelProperty(value = "选项名称")
    @NotEmpty(message = "选项名称不能为空")
    private String optionName;

    @ApiModelProperty(value = "作者名称")
    private String authorName;

    @ApiModelProperty(value = "选项描述")
    private String optionDesc;

    @ApiModelProperty(value = "选项类型(0:视频, 1:图片)")
    @NotNull(message = "选项类型不能为空")
    private Integer type;

    @ApiModelProperty(value = "素材URL数组")
    @NotEmpty(message = "素材不能为空")
    private String materialUrls;

    @ApiModelProperty(value = "封面URL")
    @NotEmpty(message = "封面不能为空")
    private String coverUrl;

    @ApiModelProperty(value = "选项来源(来源活动ID), 为空代表本地上传")
    private Integer sourceId;

    @ApiModelProperty(value = "数据状态(0:删除, 1:正常)")
    @TableLogic
    @TableField(select = false)
    private Integer status;

    @ApiModelProperty(value = "创建人id")
    @TableField(select = false)
    private String createdBy;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(select = false)
    private LocalDateTime createdDate;

    @ApiModelProperty(value = "更新人id")
    @TableField(select = false)
    private String updatedBy;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(select = false)
    private LocalDateTime updatedDate;

}
